<template>
  <h1>app</h1>
  <breadCrumb :data="data" sepearator="/"></breadCrumb>
  <router-view></router-view>
</template>
<script setup>
import { ref, getCurrentInstance, onMounted } from "vue";
// let data = ref([{ meta: { name: "导航首页" }, name: "/" }]);
let data = ref([]);

onMounted(() => {
  console.log(getCurrentInstance());
  //获取组件实例
  let instance = getCurrentInstance();
  //获取app全局添加的属性
  let $bus = instance.appContext.config.globalProperties.$bus;
  //发布事件
  $bus.$on("breadChange", (input) => {
    // console.log(input);
    data.value = input;
  });
});
</script>

<style scoped></style>
